home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / zendisk2.zip / LST11-5.ASM < prev    next >
Assembly Source File  |  1990-02-15  |  541b  |  28 lines

  1. ;
  2. ; *** Listing 11-5 ***
  3. ;
  4. ; Sets the high bit of every element in a byte
  5. ; array using LODSB and STOSB.
  6. ;
  7.     jmp    Skip
  8. ;
  9. ;
  10. ARRAY_LENGTH    equ    1000
  11. ByteArray    db    ARRAY_LENGTH dup (?)
  12. ;
  13. Skip:
  14.     call    ZTimerOn
  15.     mov    si,offset ByteArray    ;point to the array
  16.     mov    di,ds            ; as both source and
  17.     mov    es,di            ; destination
  18.     mov    di,si
  19.     mov    cx,ARRAY_LENGTH
  20.     mov    ah,80h            ;bit pattern to OR
  21.     cld
  22. SetHighBitLoop:
  23.     lodsb                ;get the next byte
  24.     or    al,ah            ;set the high bit
  25.     stosb                ;save the byte
  26.     loop    SetHighBitLoop
  27.     call    ZTimerOff
  28.